package com.ftg.learn.controller;

import java.lang.reflect.Proxy;

/**
 * 代理
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/6/27 下午4:36
 */
public class SingerProxy implements ISinger {

    ISinger isinger;

    public SingerProxy(ISinger singer){
        this.isinger = singer;
    }


    @Override
    public void say() {
        System.out.println("穿漂亮点，老吴喜欢！因为lsp");
        isinger.say();
        System.out.println("鞠躬");
    }

    public static void main(String[] args) {
        ISinger wxy = new ManSinger();

        wxy.say();

//        Proxy jdk
//        cglib 引一个包
        ISinger wu = new SingerProxy(wxy);
        wu.say();
    }

}
